package com.sc.nft.admin.controller;

import com.sc.nft.admin.request.MiniMallDistributionUserReq;
import com.sc.nft.annotation.SysMemberLogin;
import com.sc.nft.entity.vo.minimall.WxMiniMallDistributionVO;
import com.sc.nft.feign.WxMiniHomeClient;
import com.sc.nft.req.home.HomePageReq;
import com.sc.nft.service.WxMiniDistributionUserService;
import com.sc.nft.sup.PageResult;
import com.sc.nft.sup.Result;
import com.sc.nft.vo.home.HomePageDetailsVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/admin/wxMiniMall/distributionUser")
@Api(tags = "小程序分销员")
public class WxMiniDistributionUserController {

    private final WxMiniDistributionUserService wxMiniDistributionUserService;

    /**
     * 小程序主页创建
     * @param request
     * @return
     */
    @PostMapping(value = "/adminPage", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "小程序分销员列表")
    @SysMemberLogin
    public PageResult<WxMiniMallDistributionVO> adminPage(@RequestBody MiniMallDistributionUserReq request) {
        return PageResult.success(wxMiniDistributionUserService.adminPage(request.getUserTel(),request.getPageNo(),request.getPageSize()));

    }

}